package com.kingmed.kmss.common.enums.admin;

import cn.hutool.core.util.StrUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 用户账号来源
 */
@Getter
@AllArgsConstructor
public enum UserSource {

    OA_USER("oa", "OA系统"),
    CRM_USER("crm", "crm自建用户");

    private final String userType;
    private final String userTypeValue;

    public static UserSource getUserType(String str) {
        for (UserSource value : values()) {
            if (StrUtil.contains(str, value.getUserType())) {
                return value;
            }
        }
        throw new RuntimeException("'UserType' not found By " + str);
    }
}
